<template>
  <div class="home">
    <!-- 我是首页 -->
    <!-- 三级联动组件注册为全图组件 -->
    <TypeNav />
    <ListContainer />
    <recommend />
    <Rank />
    <Like />
    <Floor v-for="floor in floorList" :key="floor.id" :list="floor" />
    <Brand />
  </div>
</template>
<script>
// 引入其他的组件
import ListContainer from './ListContainer'
import recommend from './Recommend'
import Rank from './Reak'
import Like from './Like'
import Floor from './Floor'
import Brand from './Brand'
import { mapState } from 'vuex'

export default {
  name: "home",
  components: { ListContainer: ListContainer, recommend: recommend, Rank: Rank, Like: Like, Floor: Floor, Brand: Brand },
  mounted() {
    this.$store.dispatch('getFloorList')
  },
  computed: {
    ...mapState({
      floorList: (state) => {
        return state.home.floorList

      }
    })
  },
};
</script>
<style scoped>
</style>
